#include <scdl/parser/RefCnt.hpp>

using namespace scdl;

RefCnt::RefCnt()
        : __ref(1)
{
}

RefCnt::~RefCnt()
{
}

void RefCnt::ref()
{
        __ref ++;
}

void RefCnt::unref()
{
        if (-- __ref == 0) {
                delete this;
        }
}